//
//  TopPublishTraRepView.m
//  LoveTrail
//
//  Created by giantumbrella on 15/6/27.
//  Copyright (c) 2015年 赵娟. All rights reserved.
//

#import "TopPublishTraRepView.h"
#import "CommonMacro.h"

@interface TopPublishTraRepView ()
@property (nonatomic,strong) UILabel *descriptionLabel;
@property (nonatomic,strong) UILabel *titleLabel;
@property (nonatomic,strong) UIView *lineView;
@property (nonatomic,strong) UIImageView *productImageView;
@property (nonatomic,strong) UIImageView *startImageView;
@property (nonatomic,strong) UIView *startView;

@end
@implementation TopPublishTraRepView

- (id)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        [self createSubview];
        self.layer.borderColor = UIColorWithRGBA(218, 215, 215, 1).CGColor;
        self.layer.borderWidth = 1;
        
    }
    return self;
}

- (void)createSubview
{
    //1.给试用产品打分
    self.descriptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 5,self.frame.size.width*0.4, self.frame.size.height*0.1)];
    [self addSubview:self.descriptionLabel];
    self.descriptionLabel.text = @"给试用品打分";
    self.descriptionLabel.textColor = UIColorWithRGBA(94, 94, 94, 1);
    self.descriptionLabel.font = [UIFont boldSystemFontOfSize:14];
    //2.线
    self.lineView = [[UIView alloc] initWithFrame:CGRectMake(0, self.descriptionLabel.frame.size.height+self.descriptionLabel.frame.origin.y+5, self.frame.size.width, 1)];
    [self addSubview:self.lineView];
    self.lineView.backgroundColor = UIColorWithRGBA(217, 217, 217, 1);
    //3.产品图片
    self.productImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, self.lineView.frame.size.height+self.lineView.frame.origin.y+5, self.frame.size.width*0.35, self.frame.size.width*0.35)];
    [self addSubview:self.productImageView];
//    self.productImageView.backgroundColor = [UIColor redColor];
    self.productImageView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"大牌专区"]];
    //4.名称
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.productImageView.frame.origin.x+self.productImageView.frame.size.width+5, self.productImageView.frame.origin.y, self.frame.size.width*0.6, self.frame.size.height*0.3)];
    [self addSubview:self.titleLabel];
    self.titleLabel.text = @"原产美国雅培精装婴幼儿奶粉";
    self.titleLabel.textColor = UIColorWithRGBA(48, 48, 48, 1);
    self.titleLabel.font = [UIFont boldSystemFontOfSize:14];
    self.titleLabel.numberOfLines = 0;
    [self.titleLabel sizeToFit];
    //4.小星星
    self.startView = [[UIView alloc] initWithFrame:CGRectMake(self.titleLabel.frame.origin.x, self.titleLabel.frame.origin.y+self.titleLabel.frame.size.height, self.titleLabel.frame.size.width, self.frame.size.height*0.3)];
    [self addSubview:self.startView];
    self.startView.backgroundColor = [UIColor greenColor];
    
}
@end
